<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: riff_wave.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">riff_wave.h</div>  </div>
</div>
<div class="contents">
<a href="riff__wave_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="preprocessor">#ifndef __RIFF_WAVE_H__</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#define __RIFF_WAVE_H__ 1</span>
<a name="l00004"></a>00004 <span class="preprocessor"></span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="wave__format__tag_8h.html">wave_format_tag.h</a>&quot;</span>
<a name="l00010"></a>00010 
<a name="l00056"></a><a class="code" href="classCRiffWave.html">00056</a> <span class="keyword">class </span><a class="code" href="classCRiffWave.html">CRiffWave</a>
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <span class="keyword">public</span>:
<a name="l00059"></a>00059         <a class="code" href="classCRiffWave.html#af7cb2859bae8cc8741fb5b5cea270d46">CRiffWave</a>();
<a name="l00060"></a>00060         <span class="keyword">virtual</span> <a class="code" href="classCRiffWave.html#a45ca46c2884a859ae48c93af05641088">~CRiffWave</a>();
<a name="l00061"></a>00061         
<a name="l00067"></a>00067         <span class="keywordtype">bool</span> <a class="code" href="classCRiffWave.html#ab4b2b41c42b9f0ffc676bc0502281bd1">open</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pFilename);
<a name="l00068"></a>00068         
<a name="l00074"></a>00074         <span class="keywordtype">bool</span> <a class="code" href="classCRiffWave.html#a05b57daa4a7324d771be4aa0bebf192c">close</a>();
<a name="l00075"></a>00075         
<a name="l00081"></a>00081         std::string <a class="code" href="classCRiffWave.html#ad0c6907ca7701143404432cdf58a99c2">getWaveInfo</a>();
<a name="l00082"></a>00082 
<a name="l00090"></a>00090         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a25877409f6b4c22be609f3a4405bcfc4">sampleCount</a>();
<a name="l00091"></a>00091 
<a name="l00092"></a>00092         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a1c23e8ffd759ebee0a3d068100a7da9d">frameCount</a>();
<a name="l00093"></a>00093         
<a name="l00100"></a>00100         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a647459735e2ed86e24af62db71a31501">channels</a>();
<a name="l00101"></a>00101 
<a name="l00102"></a>00102         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#af186e7211f37fb5eb767a5eece3a66b5">frameRate</a>();
<a name="l00103"></a>00103 
<a name="l00104"></a>00104         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a3559c06f83db0449485b25d0306c0a08">bitsPerSample</a>();
<a name="l00105"></a>00105 
<a name="l00109"></a>00109         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a35422c38e7ead166850cd801d06e568b">bytePerSample</a>();
<a name="l00110"></a>00110 
<a name="l00116"></a>00116         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a4a0c3065a19d754f48a5ddb3d9f83ab0">bytePerFrame</a>();
<a name="l00117"></a>00117 
<a name="l00118"></a>00118         <a class="code" href="namespaceNWaveFormatTag.html#a984a591ddf2ea06019b5881d5b83364d">NWaveFormatTag::EFormatTag</a> <a class="code" href="classCRiffWave.html#a0699c31cbe0cebdfda1dbdef928abdd7">getFormatTag</a>();
<a name="l00119"></a>00119 
<a name="l00125"></a>00125         <span class="keywordtype">bool</span> <a class="code" href="classCRiffWave.html#a6c7f59a56f8e4073b419f75c60d6002d">begin</a>();
<a name="l00126"></a>00126         
<a name="l00139"></a>00139         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a717df5922e4386722efab8c913ba1820">getNextSamples</a>(<span class="keywordtype">void</span>* pSamples,
<a name="l00140"></a>00140                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount,
<a name="l00141"></a>00141                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> &amp;pStartOffset);
<a name="l00142"></a>00142         
<a name="l00153"></a>00153         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#a7401a7f3e13c02ec289222a34724a1da">readSamples</a>(<span class="keywordtype">void</span>* pSamples,
<a name="l00154"></a>00154                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pOffset,
<a name="l00155"></a>00155                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount);
<a name="l00156"></a>00156         
<a name="l00167"></a>00167         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCRiffWave.html#afc325e0a787a5068ee2a3cbeca68d784">writeSamples</a>(<span class="keywordtype">void</span>* pSamples,
<a name="l00168"></a>00168                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pOffset,
<a name="l00169"></a>00169                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount);
<a name="l00170"></a>00170         
<a name="l00177"></a>00177         <span class="keywordtype">bool</span> <a class="code" href="classCRiffWave.html#ab59a272f8efaa59beb6820fd8551463c">flipEverySecondSample</a>();
<a name="l00178"></a>00178 <span class="keyword">private</span>:
<a name="l00179"></a><a class="code" href="classCRiffWave.html#a5b6a2f65939fb489c62c5c5090aa3f5b">00179</a>         std::fstream <a class="code" href="classCRiffWave.html#a5b6a2f65939fb489c62c5c5090aa3f5b">mWav</a>;
<a name="l00180"></a>00180         
<a name="l00181"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html">00181</a>         <span class="keyword">struct </span><a class="code" href="structCRiffWave_1_1SFormatChunk.html">SFormatChunk</a>
<a name="l00182"></a>00182         {
<a name="l00183"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#ae96bb6b6a03c30f9751d99434f043ec6">00183</a>                 <a class="code" href="structCRiffWave_1_1SFormatChunk.html#ae96bb6b6a03c30f9751d99434f043ec6">SFormatChunk</a>()
<a name="l00184"></a>00184                                 :<a class="code" href="structCRiffWave_1_1SFormatChunk.html#aa344d657764722073b1d89dc52d60f8b">formatTag</a>(0), channels(0), <a class="code" href="structCRiffWave_1_1SFormatChunk.html#a129baa4beb1f530c4e385fae4ee6dc34">samplesPerSec</a>(0),
<a name="l00185"></a>00185                                                 <a class="code" href="structCRiffWave_1_1SFormatChunk.html#ae6bf80c2ab5801587d0be69ed7366dd6">avgBytesPerSec</a>(0), <a class="code" href="structCRiffWave_1_1SFormatChunk.html#a98e86bb446279e0e31340eb8e4551f3f">blockAlign</a>(0), bitsPerSample(0) {}
<a name="l00186"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#aa344d657764722073b1d89dc52d60f8b">00186</a>                 uint16_t <a class="code" href="structCRiffWave_1_1SFormatChunk.html#aa344d657764722073b1d89dc52d60f8b">formatTag</a>;
<a name="l00187"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#a3ca0cd9259b708ca0f85b953b1af0637">00187</a>                 uint16_t <a class="code" href="structCRiffWave_1_1SFormatChunk.html#a3ca0cd9259b708ca0f85b953b1af0637">channels</a>;
<a name="l00188"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#a129baa4beb1f530c4e385fae4ee6dc34">00188</a>                 uint32_t <a class="code" href="structCRiffWave_1_1SFormatChunk.html#a129baa4beb1f530c4e385fae4ee6dc34">samplesPerSec</a>;
<a name="l00189"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#ae6bf80c2ab5801587d0be69ed7366dd6">00189</a>                 uint32_t <a class="code" href="structCRiffWave_1_1SFormatChunk.html#ae6bf80c2ab5801587d0be69ed7366dd6">avgBytesPerSec</a>;
<a name="l00190"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#a98e86bb446279e0e31340eb8e4551f3f">00190</a>                 uint16_t <a class="code" href="structCRiffWave_1_1SFormatChunk.html#a98e86bb446279e0e31340eb8e4551f3f">blockAlign</a>;
<a name="l00191"></a><a class="code" href="structCRiffWave_1_1SFormatChunk.html#acc97ab3d3a0afd20eb3277b920344334">00191</a>                 uint16_t <a class="code" href="structCRiffWave_1_1SFormatChunk.html#acc97ab3d3a0afd20eb3277b920344334">bitsPerSample</a>;
<a name="l00192"></a>00192         } <a class="code" href="classCRiffWave.html#a8e5b898571dc615d83aefe1b4d4b21e4">mFormat</a>;
<a name="l00193"></a>00193         
<a name="l00194"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html">00194</a>         <span class="keyword">struct </span><a class="code" href="structCRiffWave_1_1SDataChunk.html">SDataChunk</a>
<a name="l00195"></a>00195         {
<a name="l00196"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html#ae9288a94322f64f68f1ff90e50b6974b">00196</a>                 <a class="code" href="structCRiffWave_1_1SDataChunk.html#ae9288a94322f64f68f1ff90e50b6974b">SDataChunk</a>() :<a class="code" href="structCRiffWave_1_1SDataChunk.html#a294ccf677dc252771e31edc918a386bd">length</a>(0), <a class="code" href="structCRiffWave_1_1SDataChunk.html#a570dd253616ab892a014db9e99200a80">filePos</a>(0), bytePerSample(0),
<a name="l00197"></a>00197                                 <a class="code" href="structCRiffWave_1_1SDataChunk.html#ab2e3408ca78e7c6a5308a92627b19f23">samples</a>(0), <a class="code" href="structCRiffWave_1_1SDataChunk.html#ab826ee46e466faea09dba51ecfd69c72">currentIndex</a>(0) {}
<a name="l00198"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html#a294ccf677dc252771e31edc918a386bd">00198</a>                 uint32_t <a class="code" href="structCRiffWave_1_1SDataChunk.html#a294ccf677dc252771e31edc918a386bd">length</a>;
<a name="l00199"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html#a570dd253616ab892a014db9e99200a80">00199</a>                 std::fstream::pos_type <a class="code" href="structCRiffWave_1_1SDataChunk.html#a570dd253616ab892a014db9e99200a80">filePos</a>;
<a name="l00200"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html#aa27b63353eeb45d7a5609752d22c0239">00200</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structCRiffWave_1_1SDataChunk.html#aa27b63353eeb45d7a5609752d22c0239">bytePerSample</a>;
<a name="l00201"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html#ab2e3408ca78e7c6a5308a92627b19f23">00201</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structCRiffWave_1_1SDataChunk.html#ab2e3408ca78e7c6a5308a92627b19f23">samples</a>;
<a name="l00202"></a><a class="code" href="structCRiffWave_1_1SDataChunk.html#ab826ee46e466faea09dba51ecfd69c72">00202</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structCRiffWave_1_1SDataChunk.html#ab826ee46e466faea09dba51ecfd69c72">currentIndex</a>;
<a name="l00203"></a>00203         } <a class="code" href="classCRiffWave.html#a105766db7b33ada4eee53ba6c0f0733b">mData</a>;
<a name="l00204"></a>00204         
<a name="l00205"></a>00205         <span class="keywordtype">bool</span> <a class="code" href="classCRiffWave.html#aea2b9dd65ba7d5715813bcf5ff5a3db3">openWave</a>();
<a name="l00206"></a>00206 };
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:39 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
